package com.jsy.mydbutilproject;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.jsy.mydbutil.MyDataBase;
import com.jsy.mydbutil.MyDbUtil;

import java.util.List;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TestEntity te = new TestEntity();
        te.name = "11111";
        try {
            MyDbUtil.insert(TestDb.tableName,te);
            te.name = "22222";
            MyDbUtil.insert(TestDb.tableName,te);
            te.name = "dsfsdf";
            MyDbUtil.insert(TestDb.tableName,te);
            te.name = "666666666";
            MyDbUtil.insert(TestDb.tableName,te);
        } catch (Exception e) {
            e.printStackTrace();
        }
        List<TestEntity> list =  MyDbUtil.queryAll(TestEntity.class,TestDb.tableName);
        Log.e("list",list.toString());
    }
}
